package com.aaa.entity;

import cn.hutool.core.util.ObjectUtil;
import lombok.Data;

/**
 * 分页信息和排序信息
 */
@Data
public class PageSortEntity {
    Integer page;
    Integer limit;
    String field;
    String order;
   public String  getOrderString(){
       if(ObjectUtil.isNotEmpty(field)){
           return this.getField()+" "+this.getOrder();
       }
       return null;
    }

    public static PageSortEntity  noPage(){

        PageSortEntity pageSortEntity = new PageSortEntity();
        pageSortEntity.setPage(1);
        pageSortEntity.setLimit(Integer.MAX_VALUE);
        return pageSortEntity;

    }
}
